﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PragmaTouchUtils;
using System.IO;

namespace eBook.WinApp
{
  public partial class ucFolderOptions : ucOptionEditorBase, IConfigContentEditor
  {
    private string _appPath;

    public ucFolderOptions()
    {
      InitializeComponent();

      this.ItemClassName = "FolderOptions";
      this.Caption = "Folders"; 
    }

    protected override void LoadInitial()
    {
      FolderOptions options = _currentConfig.GetConfigContentItem(this.ItemClassName) as FolderOptions;
      if ( options == null )
        throw new Exception(string.Format("Configuration content does not contain {0} item!", this.ItemClassName));

      txtDocumentOutputPath.DataBindTo(options, "DocumentOutputPath", this.ControlValueChanged);
      txtLibraryBasePath.DataBindTo(options, "LibraryBasePath", this.ControlValueChanged);
    }

    private void ControlValueChanged(object sender, EventArgs e)
    {
      this.Modified = true;
    }




  }
}
